var __ff_ui;
$(function() {
	__ff_ui = new RBCFeedUI();
});

function RBCFeedUI() {
	limit = 141;
	loggedIn = false;
	rbcfeed = new RBCFeed("https://rbchool2.firebaseio.com/");
	unload = null;

	// Setup page navigation.
	//setupHandlers();

	// Setup History listener.
	/**
	 window.History.Adapter.bind(window, "statechange", function() {
	 pageController(window.History.getState().hash, false);
	 });**/

	console.log('Constructor init');

	rbcfeed.onLoginStateChange(function(error, user) {
		self.onLoginStateChange(error, user);
	});

	var loginButton = $("#login-button");
	loginButton.click(function(e) {
		console.log('Trying to login');
	});

	var createAccountButton = $("#createaccount-button");
	createAccountButton.click(function(e) {
		console.log('Account created');
	});
};

RBCFeedUI.prototype.renderHome = function(e) {
	if (loggedIn) {
		alert('Already logged in');
		return;
	}

	alert('not logged in');
}; 